#define _CRT_SECURE_NO_WARNINGS 1
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'

void solve() {
	string s; cin >> s;
	string str;
	for (int i = 0; i < 20; i++) str += "Yes";
	cout << (str.find(s) == -1 ? "NO" : "YES") << endl;
}

int main() {
	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	int t; cin >> t;
	while (t--) {
		solve();
	}
	return 0;
}